﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace LoRel
{
    public delegate void ChangeHandler(ChangeNoticeArgs args);
    
    public enum ChangeType {
        Add, Remove, Update, Clear
    }


    public class ChangeNotifyItem {
        public readonly Object NewValue;
        public readonly Object OldValue;
        
        public ChangeNotifyItem( object new_value, object old_value ) {
            NewValue = new_value;
            OldValue = old_value;
        }
    }

    public class ChangeNoticeArgs {
        private readonly ChangeType m_ChangeType;
        private readonly IEnumerable< ChangeNotifyItem > m_ChangedItems;

        public ChangeNoticeArgs( ChangeType change_type, IEnumerable< ChangeNotifyItem > changed_items ) {
            m_ChangeType = change_type;
            m_ChangedItems = changed_items;
        }

        public ChangeType ChangeType { get { return m_ChangeType; } }
        public IEnumerable< ChangeNotifyItem > ChangedItems { get { return m_ChangedItems; } }
    }
}
